package com.leio;

import com.leio.learn.ShowCountResultActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class AndroidlearnActivity extends Activity {

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		Button btnSend = (Button) this.findViewById(R.id.btnSend);
		btnSend.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				EditText et1 = (EditText) findViewById(R.id.d1);
				EditText et2 = (EditText) findViewById(R.id.d2);
				Intent intent = new Intent();
				Bundle bundle = new Bundle();
				bundle.putString("d1", et1.getText().toString());
				bundle.putString("d2", et2.getText().toString());
				intent.putExtras(bundle);
				intent.setClass(AndroidlearnActivity.this,
						ShowCountResultActivity.class);
				startActivity(intent);
				AndroidlearnActivity.this.finish();

			}
		});

	}
}